﻿using System.IO;
using UnityEditor;

public class Tool
{
    private static string DLLPATH = "Assets/HotFix/HotFix_Project.dll";
    private static string PDBPATH = "Assets/HotFix/HotFix_Project.pdb";

    [MenuItem("Tools/修改热更Dll 为txt")]
    public static void ChangeDllName()
    {
        string targetDllPath = DLLPATH + ".txt";
        string targetPdbPath = PDBPATH + ".txt";
        if (File.Exists(targetDllPath))
        {
            File.Delete(targetDllPath);
        }
        if (File.Exists(targetPdbPath))
        {
            File.Delete(targetPdbPath);
        }
        if (File.Exists(DLLPATH))
        {
            File.Move(DLLPATH, targetDllPath);
        }
        if (File.Exists(PDBPATH))
        {
            File.Move(PDBPATH, targetPdbPath);
        }
        AssetDatabase.Refresh();
    }
}
